package com.itheima.health.dao;

import com.itheima.health.pojo.Order;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderDao {
    /**
     *根据会员，时间，套餐id查询
     * @param memberId
     * @param orderDate
     * @param setmealId
     * @return
     */
    long countByMemberAndDateAndSetMeal(@Param("memberId") Integer memberId, @Param("orderDate") Date orderDate, @Param("setmealId") Integer setmealId);

    /**
     * 添加
     * @param order
     */
    void insert(Order order);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    Order selectById(@Param("id") Integer id);

    List<Map<String, Object>> countBySetmeal();

    Long countByOrderDateRange(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

    Long countByOrderDateRange(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("status") String status);

    List<Map<String, Object>> countByHotSetmeal(@Param("i") Integer i);
}
